Advanced Concurrency in Java by Ajay Kumar
Author:Ajay Kumar [Kumar, Ajay]
Language: eng
Format: azw3
Publisher: UNKNOWN
Published: 2018-11-13T16:00:00+00:00
Java Coding Wrap-up
How to properly lock a Producer / Consumer with Lock
How to deal with exceptions and timeout
How HashMapcan fail in a concurrent application
How to properly synchronize it using a pair of read / write locks
So let us quickly wrap up this Java coding session. What did we see in the code? First of all, we saw how to properly lock the producer/consumer pattern with instances of this lock interface, which is ReentrantLock. We then saw how it was possible to deal with exceptions properly and timeouts using this pattern, which was not possible with the object.wait and notify pattern. And in a second example, we saw the HashMap in action in a concurrent environment and how easy it is to make it fail in such an environment. The HashMap implementation is not thread-safe, so do not use it in a concurrent application without precautions. So we also saw how to properly synchronize it, and for that, we used a pair of read/write locks. We did that to ensure a better throughput, especially with parallel read operations on this map and handle than the fully-synchronized version of the HashMap you can build using the collections.SynchronizeMap method. Last note on this point, we will also see thread-safe implementations of maps, concurrent skip list maps, and concurrent HashMaps in the last module of this book.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(27094)
Hello! Python by Anthony Briggs(25949)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(25285)
Kotlin in Action by Dmitry Jemerov(24393)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(23591)
Dependency Injection in .NET by Mark Seemann(23313)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(21944)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(20848)
Grails in Action by Glen Smith Peter Ledbrook(19869)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17072)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(16832)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(14464)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(12584)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11865)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10650)
Hit Refresh by Satya Nadella(9237)
The Kubernetes Operator Framework Book by Michael Dame(8588)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8445)
Robo-Advisor with Python by Aki Ranin(8387)